import logging
import redis  # redis数据库

# 配置信息
class Config(object):


    # 配置mysql数据库
    SQLALCHEMY_DATABASE_URI= 'mysql://root:mysql@127.0.0.1/information11'
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    # 配置redis数据库
    REDIS_HOST = '127.0.0.1'
    REDIS_PORT = '6379'
    SECRET_KEY = 'fffff'


    # Flask_session配置信息
    SESSION_TYPE = 'redis'  # 指定session保存到redis中
    SESSION_USE_SIGNER = True  # 让cookie中的session_id被加密签名处理
    SESSION_REDIS = redis.StrictRedis(host=REDIS_HOST, port=REDIS_PORT)
    PERMANENT_SESSION_LIFETIME = 86400  # session的有效期，单位是秒


class ProductionConfig(Config):
    DEBUG = False
    LOG_LEVEL = logging.WARN

class DevelopmentConfig(Config):
    DEBUG = True
    LOG_LEVEL = logging.DEBUG